package Text21;

import java.util.Scanner;

public class Main {
    static int N = 100010;
    static int[] w = new int[N];
    static long[] s = new long[N];

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        for (int i = 1; i <= n; i++) {
            w[i] = in.nextInt();
            s[i] = s[i - 1] + w[i];
        }
        long res = 1, summax = -N;
        for (int d = 1, i = 1; i <= n; d++, i *= 2) {
            long sum = 0;
            if (2 * i - 1 > n) {
                sum = s[n] - s[i - 1];
            } else {
                sum = s[2 * i - 1] - s[i - 1];
            }
            if (sum > summax) {
                summax = sum;
                res = d;
            }
        }
        System.out.println(res);
    }
}
